package internalAPI;

/**
 * Class that represents the lattitude and longtitude, both in range <-180.0 deg 180.0 deg>
 * @author Lukas Rucka, Masaryk University, Brno, Czech Republic, xrucka@fi.muni.cz
 */
public class LatLng {
    private float lat;
    private float lng;

    public LatLng(float lat, float lng){

    }

    public void setLat(float lat){ lat = roundCoordinate(lat); }
    public void setLng(float lng){ lng = roundCoordinate(lng); }

    public float getLat(){ return lat; }
    public float getLng(){ return lng; }

    private float roundCoordinate(float coord){
        float tmp = coord + 180f;
        tmp = tmp - (((long)(tmp/360f))*360f);
        return tmp - 180.0f;
    }

}
